{"ast":null,"code":"export default function buildMatchFn(args) {\n  return function (string) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var width = options.width;\n    var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n    var matchResult = string.match(matchPattern);\n    if (!matchResult) {\n      return null;\n    }\n    var matchedString = matchResult[0];\n    var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n    var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    }) : findKey(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    });\n    var value;\n    value = args.valueCallback ? args.valueCallback(key) : key;\n    value = options.valueCallback ? options.valueCallback(value) : value;\n    var rest = string.slice(matchedString.length);\n    return {\n      value: value,\n      rest: rest\n    };\n  };\n}\nfunction findKey(object, predicate) {\n  for (var key in object) {\n    if (object.hasOwnProperty(key) && predicate(object[key])) {\n      return key;\n    }\n  }\n  return undefined;\n}\nfunction findIndex(array, predicate) {\n  for (var key = 0; key < array.length; key++) {\n    if (predicate(array[key])) {\n      return key;\n    }\n  }\n  return undefined;\n}","map":{"version":3,"names":["buildMatchFn","args","string","options","arguments","length","undefined","width","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","key","Array","isArray","findIndex","pattern","test","findKey","value","valueCallback","rest","slice","object","predicate","hasOwnProperty","array"],"sources":["/data/messenger.client/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js"],"sourcesContent":["export default function buildMatchFn(args) {\n  return function (string) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var width = options.width;\n    var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n    var matchResult = string.match(matchPattern);\n\n    if (!matchResult) {\n      return null;\n    }\n\n    var matchedString = matchResult[0];\n    var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n    var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    }) : findKey(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    });\n    var value;\n    value = args.valueCallback ? args.valueCallback(key) : key;\n    value = options.valueCallback ? options.valueCallback(value) : value;\n    var rest = string.slice(matchedString.length);\n    return {\n      value: value,\n      rest: rest\n    };\n  };\n}\n\nfunction findKey(object, predicate) {\n  for (var key in object) {\n    if (object.hasOwnProperty(key) && predicate(object[key])) {\n      return key;\n    }\n  }\n\n  return undefined;\n}\n\nfunction findIndex(array, predicate) {\n  for (var key = 0; key < array.length; key++) {\n    if (predicate(array[key])) {\n      return key;\n    }\n  }\n\n  return undefined;\n}"],"mappings":"AAAA,eAAe,SAASA,YAAY,CAACC,IAAI,EAAE;EACzC,OAAO,UAAUC,MAAM,EAAE;IACvB,IAAIC,OAAO,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAKE,SAAS,GAAGF,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACpF,IAAIG,KAAK,GAAGJ,OAAO,CAACI,KAAK;IACzB,IAAIC,YAAY,GAAGD,KAAK,IAAIN,IAAI,CAACQ,aAAa,CAACF,KAAK,CAAC,IAAIN,IAAI,CAACQ,aAAa,CAACR,IAAI,CAACS,iBAAiB,CAAC;IACnG,IAAIC,WAAW,GAAGT,MAAM,CAACU,KAAK,CAACJ,YAAY,CAAC;IAE5C,IAAI,CAACG,WAAW,EAAE;MAChB,OAAO,IAAI;IACb;IAEA,IAAIE,aAAa,GAAGF,WAAW,CAAC,CAAC,CAAC;IAClC,IAAIG,aAAa,GAAGP,KAAK,IAAIN,IAAI,CAACa,aAAa,CAACP,KAAK,CAAC,IAAIN,IAAI,CAACa,aAAa,CAACb,IAAI,CAACc,iBAAiB,CAAC;IACpG,IAAIC,GAAG,GAAGC,KAAK,CAACC,OAAO,CAACJ,aAAa,CAAC,GAA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